#include <QApplication>
#include <QPushButton>
#include <QLabel>

int main(int argc, char *argv[])
{
	QApplication app(argc,argv);

	//创建一个button
	QPushButton *btn = new QPushButton("关闭");
	btn->setWindowTitle("Close");

	//创建一个Label
	QLabel *lab = new QLabel("点击然后关闭我！");
	lab->setWindowTitle("Close");
	
	//展示窗口
	btn->show();
	lab->show();

	//连接信号与槽
	QObject::connect(btn,SIGNAL(clicked(void)),
			lab,SLOT(close()));

	return app.exec();
}
